﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HttpListenerApplication
{
    public class DevicesHelper
    {
        private static IDevices d = new DefaultDevices();

        public static string getRegterInfo()
        {
            string pc = d.mainBoardId() + "##" + d.systemInstallDay();
            return pc;
        }

        public static string getPCUUID(string left, string right)
        {
            string pc = d.mainBoardId() + d.systemInstallDay();
            string source = "", nowstr = now();
            source = left + nowstr + pc + nowstr + right;
            return nowstr + "##" + MD5Util.StrToMD5(source) + "##" + left + "##" + right;
        }

        private static string now()
        {
            TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
            string ret = Convert.ToInt64(ts.TotalMilliseconds).ToString();
            return ret;
        }
    }
}
